﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cofe.Core
{
    public static class ICofeSystemInfoExtension
    {
        public static ICofeDirectoryInfo[] GetHierarchy(this ICofeSystemInfo entry)
        {
            List<ICofeDirectoryInfo> retList = new List<ICofeDirectoryInfo>();

            var current = entry.Parent;
            while (current != null)
            {
                retList.Add(current);
                current = current.Parent;
            }

            retList.Reverse();
            return retList.ToArray();
        }

    
    }
}
